<div class="form">
<?php $form = $this
	->beginWidget('CActiveForm',
		array(
			'id' => 'employee-form',
			'enableAjaxValidation' => false,
			'htmlOptions' => array(
				'enctype' => 'multipart/form-data'
			)
		));
?>

	<?php echo $form->errorSummary($model); ?>
<fieldset>
<legend>总览</legend>

	<div class="span-5">
		<?php echo $form->labelEx($model, 'employed'); ?>
		<?php echo $form->checkBox($model, 'employed'); ?>
		<?php echo $form->dropDownList($model, 'status', Employee::getAllStatus()); ?>
		<?php echo $form->error($model, 'employed'); ?>
	</div>

	<div class="span-7">
		<?php echo $form->labelEx($model, 'documentNumber'); ?>
		<?php echo $form
			->textField($model, 'documentNumber',
				array(
					'size' => 15,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'documentNumber'); ?>
	</div>
	<div class="span-8 last">
		<?php echo $form->labelEx($model, 'currentProjectId'); ?>
		<?php $this
			->widget('widgets.project.JProjectSelector',
				array(
					'model' => $model,
					'attribute' => 'currentProjectId',
				));
		?>
		<?php echo $form->error($model, 'currentProjectId'); ?>
	</div>

</fieldset>
	
<fieldset>

<legend>基本情况</legend>
	<div class="span-14">
	<div class="span-4">
		<?php echo $form->labelEx($model, 'familyName'); ?>
		<?php echo $form
			->textField($model, 'familyName', array(
				'size' => 2,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'familyName'); ?>
	</div>

	<div class="span-5">
		<?php echo $form->labelEx($model, 'givenName'); ?>
		<?php echo $form
			->textField($model, 'givenName', array(
				'size' => 3,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'givenName'); ?>
	</div>

	<div class="span-5 last">
		<?php echo $form->labelEx($model, 'gender'); ?>
		<?php echo $form
			->dropDownList($model, 'gender', JHTML::getGenders(),
				array(
					'empty' => ''
				));
		?>
		<?php echo $form->error($model, 'gender'); ?>
	</div>

	<div class="span-7">
		<?php echo $form->labelEx($model, 'ethnicGroup'); ?>
		<?php echo $form
			->textField($model, 'ethnicGroup', array(
				'size' => 20,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'ethnicGroup'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'homeTown'); ?>
		<?php echo $form
			->textField($model, 'homeTown', array(
				'size' => 20,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'homeTown'); ?>
	</div>

	<div class="span-7">
		<?php echo $form->labelEx($model, 'education'); ?>
		<?php echo $form
			->textField($model, 'education', array(
				'size' => 20,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'education'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'profession'); ?>
		<?php echo $form
			->textField($model, 'profession', array(
				'size' => 20,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'profession'); ?>
	</div>
	<div class="span-7">
		<?php echo $form->labelEx($model, 'dateOfBirth'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'dateOfBirth',
				));
		?>
		<?php echo $form->error($model, 'dateOfBirth'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'healthCondition'); ?>
		<?php echo $form
			->textField($model, 'healthCondition',
				array(
					'size' => 20,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'healthCondition'); ?>
	</div>
	
	<div class="span-7">
		<?php echo $form->labelEx($model, 'hireDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'hireDate',
				));
		?>
		<?php echo $form->error($model, 'hireDate'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'maritalStatus'); ?>
		<?php echo $form
			->textField($model, 'maritalStatus',
				array(
					'size' => 20,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'maritalStatus'); ?>
	</div>
	
	<div class="span-7">
		<?php echo $form->labelEx($model, 'currentRank'); ?>
		<?php echo $form
			->textField($model, 'currentRank', array(
				'size' => 20,
				'maxlength' => 255
			));
		?>
		<?php echo $form->error($model, 'currentRank'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'politicalStatus'); ?>
		<?php echo $form
			->textField($model, 'politicalStatus',
				array(
					'size' => 20,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'politicalStatus'); ?>
	</div>
	
	<div class="span-7">
		<?php echo $form->labelEx($model, 'contactMobile'); ?>
		<?php echo $form
			->textField($model, 'contactMobile',
				array(
					'size' => 20,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'contactMobile'); ?>
	</div>

	<div class="span-7 last">
		<?php echo $form->labelEx($model, 'contactPhone'); ?>
		<?php echo $form
			->textField($model, 'contactPhone',
				array(
					'size' => 20,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'contactPhone'); ?>
	</div>
	
</div>

	<div class="span-5 last">
		<?php echo $form->labelEx($model, 'personalPhotoFile'); ?>
		<?php echo $form->fileField($model, 'personalPhotoFile'); ?>
		<?php echo $form->error($model, 'personalPhotoFile'); ?>
		<?php if ($model->personalPhotoThumb) {
			echo CHtml::link(
				CHtml::image(
					Yii::app()->baseUrl . '/uploads/employeePhoto/tn/' . $model->personalPhotoThumb),
				Yii::app()->baseUrl . '/uploads/employeePhoto/' . $model->personalPhotoFile,
				array(
					'target' => '_blank'
				));
		}
		?>
	</div>
<div class="clear"></div>

	<div class="row">
		<?php echo $form->labelEx($model, 'originalHomeAddress'); ?>
		<?php echo $form
			->textField($model, 'originalHomeAddress',
				array(
					'size' => 80,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'originalHomeAddress'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'currentAddress'); ?>
		<?php echo $form
			->textField($model, 'currentAddress',
				array(
					'size' => 80,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'currentAddress'); ?>
	</div>

	<div class="span-9">
		<?php echo $form->labelEx($model, 'emergencyContactName'); ?>
		<?php echo $form
			->textField($model, 'emergencyContactName',
				array(
					'size' => 30,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'emergencyContactName'); ?>
	</div>

	<div class="span-9 last">
		<?php echo $form->labelEx($model, 'emergencyContactPhone'); ?>
		<?php echo $form
			->textField($model, 'emergencyContactPhone',
				array(
					'size' => 30,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'emergencyContactPhone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'identityCardNumber'); ?>
		<?php echo $form
			->textField($model, 'identityCardNumber',
				array(
					'size' => 60,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'identityCardNumber'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'graduationSchool'); ?>
		<?php echo $form
			->textField($model, 'graduationSchool',
				array(
					'size' => 60,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'graduationSchool'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'certificates'); ?>
		<?php echo $form
			->textField($model, 'certificates',
				array(
					'size' => 60,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'certificates'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'personalHabits'); ?>
		<?php echo $form
			->textField($model, 'personalHabits',
				array(
					'size' => 60,
					'maxlength' => 255
				));
		?>
		<?php echo $form->error($model, 'personalHabits'); ?>
	</div>
</fieldset>
<fieldset>
<legend>目前福利保险</legend>
	<div class="span-4">
		<?php echo $form->labelEx($model, 'personalSocialPension'); ?>
		<?php echo $form->checkBox($model, 'personalSocialPension'); ?>
		<?php echo $form->error($model, 'personalSocialPension'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'personalSocialInjury'); ?>
		<?php echo $form->checkBox($model, 'personalSocialInjury'); ?>
		<?php echo $form->error($model, 'personalSocialInjury'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'personalSocialUemployed'); ?>
		<?php echo $form->checkBox($model, 'personalSocialUemployed'); ?>
		<?php echo $form->error($model, 'personalSocialUemployed'); ?>
	</div>
<div class="clear"></div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'personalSocialIllness'); ?>
		<?php echo $form->checkBox($model, 'personalSocialIllness'); ?>
		<?php echo $form->error($model, 'personalSocialIllness'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'personalSocialInsurance'); ?>
		<?php echo $form->checkBox($model, 'personalSocialInsurance'); ?>
		<?php echo $form->error($model, 'personalSocialInsurance'); ?>
	</div>
<div class="clear"></div>
</fieldset>
<fieldset>
<legend>其它基本情况</legend>
	<div class="row">
		<?php echo $form->labelEx($model, 'familyMembers'); ?>
		<?php echo $form
			->textArea($model, 'familyMembers', array(
				'rows' => 6,
				'cols' => 80
			));
		?>
		<?php echo $form->error($model, 'familyMembers'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'educationDetails'); ?>
		<?php echo $form
			->textArea($model, 'educationDetails', array(
				'rows' => 6,
				'cols' => 80
			));
		?>
		<?php echo $form->error($model, 'educationDetails'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'workExperience'); ?>
		<?php echo $form
			->textArea($model, 'workExperience', array(
				'rows' => 6,
				'cols' => 80
			));
		?>
		<?php echo $form->error($model, 'workExperience'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'outstandingAchievement'); ?>
		<?php echo $form
			->textArea($model, 'outstandingAchievement',
				array(
					'rows' => 6,
					'cols' => 80
				));
		?>
		<?php echo $form->error($model, 'outstandingAchievement'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model, 'note'); ?>
		<?php echo $form->textArea($model, 'note', array(
				'rows' => 6,
				'cols' => 80
			));
		?>
		<?php echo $form->error($model, 'note'); ?>
	</div>

</fieldset>

<fieldset>
<legend>用工情况</legend>
	<div class="span-9">
		<?php echo $form->labelEx($model, 'trialDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'trialDate',
				));
		?>
		<?php echo $form->error($model, 'trialDate'); ?>
	</div>

	<div class="span-9">
		<?php echo $form->labelEx($model, 'trialSalary'); ?>
		<?php echo $form
			->textField($model, 'trialSalary', array(
				'size' => 8,
				'maxlength' => 8
			));
		?>
		<?php echo $form->error($model, 'trialSalary'); ?>
	</div>
	<div class="clear"></div>
	<div class="span-9">
		<?php echo $form->labelEx($model, 'employedDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'employedDate',
				));
		?>
		<?php echo $form->error($model, 'employedDate'); ?>
	</div>

	<div class="span-9">
		<?php echo $form->labelEx($model, 'unemployedDate'); ?>
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'unemployedDate',
				));
		?>
		<?php echo $form->error($model, 'unemployedDate'); ?>
	</div>
	<div class="clear"></div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedCommitment'); ?>
		<?php echo $form->checkBox($model, 'signedCommitment'); ?>
		<?php echo $form->error($model, 'signedCommitment'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedSecrecyAgreement'); ?>
		<?php echo $form->checkBox($model, 'signedSecrecyAgreement'); ?>
		<?php echo $form->error($model, 'signedSecrecyAgreement'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedTrailContract'); ?>
		<?php echo $form->checkBox($model, 'signedTrailContract'); ?>
		<?php echo $form->error($model, 'signedTrailContract'); ?>
	</div>

	<div class="clear"></div>
	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedEmploymentContract'); ?>
		<?php echo $form->checkBox($model, 'signedEmploymentContract'); ?>
		<?php echo $form->error($model, 'signedEmploymentContract'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedGuaranteeStatement'); ?>
		<?php echo $form->checkBox($model, 'signedGuaranteeStatement'); ?>
		<?php echo $form->error($model, 'signedGuaranteeStatement'); ?>
	</div>

	<div class="span-4">
		<?php echo $form->labelEx($model, 'signedJobStatement'); ?>
		<?php echo $form->checkBox($model, 'signedJobStatement'); ?>
		<?php echo $form->error($model, 'signedJobStatement'); ?>
	</div>

	<div class="clear"></div>
	<div class="row">
		<?php echo $form->labelEx($model, 'companyNote'); ?>
		<?php echo $form
			->textArea($model, 'companyNote', array(
				'rows' => 6,
				'cols' => 80
			));
		?>
		<?php echo $form->error($model, 'companyNote'); ?>
	</div>
</fieldset>
<?php if (Yii::app()->user->checkAccess('employeeAdmin')) { ?>
	<div class="row">
		<?php echo $form->labelEx($model, 'userId'); ?>
		<?php
			$users = $this->getUnAssignedUsers();
			if (!$model->isNewRecord && $model->user != null) {
				array_unshift($users, $model->user);
			}
			echo $form
				->dropDownList($model, 'userId', CHtml::listData($users, 'id', 'username'),
					array(
						'empty' => ''
					));
		?>
		<?php echo $form->error($model, 'userId'); ?>
	</div>
<?php } ?>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '新建' : '保存'); ?>
	</div>
<?php $this->endWidget(); ?>

</div><!-- form -->
